import sys

screen_output = sys.stdout
screen_error = sys.stderr

sys.stdout = open('../resource_files/print_stdout_data.txt', 'w')
sys.stderr = open('../resource_files/print_stderrlog_data.txt', 'w')
x =  'monte'
y = list('Python')
z = [1, 2, 3]

print(x)
print(y)
print(z)

sys.stderr.write(('Oops...') * 4 + "\n")
sys.stdout.close()
sys.stderr.close()

sys.stdout = screen_output
sys.stderr = screen_error

print('back to screen...')
sys.stderr.write("An assumed error...")